/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.psi.action.supplychainmana;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.psi.mapper.supplychainmana.ReturnProMapper;
public class ReturnProAction extends BaseAction
{
    @Autowired(required=false)
	private ReturnProMapper mapper;
    /**
    产品退货
    */
    
    public Map returnPro() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        Object contact_name =mapper.contact_name(params);
        result.put("contact_name", contact_name);
        
        
        Object getdate =mapper.getdate(params);
        result.put("getdate", getdate);
        
        
        result.put("t_code", create_code(17,"bar"));
        
        
        SQLList<SQLMap> s_inout=mapper.s_inout(params);
        result.put("s_inout", s_inout);
        
        
        SQLList<SQLMap> s_firm=mapper.s_firm(params);
        result.put("s_firm", s_firm);
        
        
        SQLList<SQLMap> s_layout_item=mapper.s_layout_item(params);
        result.put("s_layout_item", s_layout_item);
        
        
        SQLList<SQLMap> s_type=mapper.s_type(params);
        result.put("s_type", s_type);
        
        
        SQLList<SQLMap> s_staff=mapper.s_staff(params);
        result.put("s_staff", s_staff);
        
        
        SQLList<SQLMap> s_top=mapper.s_top(params);
        result.put("s_top", s_top);
        
        
        SQLList<SQLMap> s_empty=mapper.s_empty(params);
        result.put("s_empty", s_empty);
        
        return result;
    }
    /**
    退货列表
    */
    
    public Map returnList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        result.put("s_search", pagination.getSearchParas());
        
        
        SQLList<SQLMap> s_firm=mapper.s_firm(params);
        result.put("s_firm", s_firm);
        
        
        params.def("firm_id",-1);
        SQLList<SQLMap> s_layout_item=mapper.s_layout_item(params);
        result.put("s_layout_item", s_layout_item);
        
        
        
        
        SQLList<SQLMap> s_record=mapper.s_record(params,pagination);
        s_record.setPagedListInfo(pagination);
        result.put("s_record", s_record);
        
        return result;
    }
    /**
    退货查看详情
    */
    
    public Map returnProDet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_stock=mapper.t_stock(params);
        SQLMap t_stock_emt=t_stock.getExistfirst();
        result.put("t_stock", t_stock_emt);
        
        
        SQLList<SQLMap> s_goods=mapper.s_goods(params);
        result.put("s_goods", s_goods);
        
        return result;
    }
    /**
    产品退货修改
    */
    
    public Map returnProSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int stock_id = mapper.stock_id(params);
        result.put("stock_id", stock_id);
        
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.record_id(params);
        }
        
        
        Object goods_insert =
        mapper.goods_insert(params);
        result.put("goods_insert", goods_insert);
        
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.goods_id(params);
        }
        
        return result;
    }
    public Map ajaxList(){
        String sql="";
        String pagesql="";
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        if(request.getParameter("cfield_name").contains("district_rack")){
            SQLList<SQLMap> district_rack=mapper.district_rack(params);
            district_rack.setSelectNone("格号");
            result.put("district_rack", district_rack);
        }
        
        
        if(request.getParameter("cfield_name").contains("district_line")){
            SQLList<SQLMap> district_line=mapper.district_line(params);
            district_line.setSelectNone("排号");
            result.put("district_line", district_line);
        }
        
        
        if(request.getParameter("cfield_name").contains("district_row")){
            SQLList<SQLMap> district_row=mapper.district_row(params);
            district_row.setSelectNone("行号");
            result.put("district_row", district_row);
        }
        
        
        if(request.getParameter("cfield_name").contains("staff_id")){
            SQLList<SQLMap> staff_id=mapper.staff_id(params);
            result.put("staff_id", staff_id);
        }
        
        return result;
    }
    public Map ajaxReturnList(){
        String sql="";
        String pagesql="";
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        if(request.getParameter("cfield_name").contains("s_layout_item")){
            SQLList<SQLMap> s_layout_item=mapper.s_layout_item(params);
            result.put("s_layout_item", s_layout_item);
        }
        
        return result;
    }
}